﻿@model Models.Models.InvoiceList
@using WebApp.Classes

@{
    ViewBag.Title = "Invoices";
    var rights = new WebApp.Classes.UserRights("Invoices");
    long storeID = ViewBag.user.StoreID;
}

@Scripts.Render("~/scripts/app/" + Path.GetFileNameWithoutExtension(Server.MapPath(VirtualPath)) + ".js")

@Html.Hidden("storeID", storeID)

    <fieldset>
        @Html.GetTitle("/Images/glyphicons/png/glyphicons_029_notes_2.png", new string[] { HttpContext.Current.Request.RequestContext.RouteData.Values["controller"].ToString() + "/" + ViewBag.Title })

        <div class="alert alert-info">
            Here's your invoices. 
            <div style='float: right' id="divRevoked">            
                Hide Revoked:
                <input type="checkbox" id="hideRevoked" style = "vertical-align: middle" @Html.Raw(ViewBag.hideRevoked == true ? "checked" : "") />
            </div>
        </div>
        
        <ul class="nav nav-tabs">
            <li class="active"><a href="#uninvoiced" data-toggle="tab" class="uninvoiced"><i class="icon-question-sign"></i>&nbsp;Unbilled</a></li>
            <li><a href="#invoiced" data-toggle="tab" class="invoiced"><i class="icon-ok-sign"></i>&nbsp;Billed</a></li>
        </ul>

        <div class="tabbable"> 
          <div class="tab-content" >
            <div class="tab-pane active" id="uninvoiced">
                @{
                    Html.RenderAction("UnInvoicedPartial", new { rights = rights, user = ViewBag.user, pageIndex = ViewBag.ubPageIndex, sortColumn = ViewBag.sortColumn, sortDirection = ViewBag.sortDirection, hideRevoked = ViewBag.hideRevoked });                       
                }                
            </div>
            <div class="tab-pane" id="invoiced">        
                @{
                    Html.RenderAction("InvoicedPartial", new { rights = rights, user = ViewBag.user, pageIndex = ViewBag.bPageIndex, sortColumn = ViewBag.sortColumn, sortDirection = ViewBag.sortDirection, createdInvoices = ViewBag.createdInvoices });
                }
            </div>
          </div>
        </div>
    </fieldset>



@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
